package com.xudu.service;

import cn.hutool.http.server.HttpServerResponse;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xudu.entity.User;
import com.xudu.utils.Resoult;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

/**
 * ClassName: IUserService
 * Description:
 *
 * @Author xudu
 * @Create 2024/4/8
 */
public interface IUserService extends IService<User> {


    /**
     * 登陆方法
     * @param username
     * @param password
     * @return
     */
    public Resoult login(String username, String password);



    /**
     * 注册方法接口
     * @param user
     * @return
     */
    public Resoult register(User user);

    /**
     * 添加用户，需要上传图片，图片保存路径保存在数据库中
     * @param username
     * @param password
     * @param photo
     * @return
     */
    public Resoult saveUserWithPhoto(String username, String password, MultipartFile photo);
    public InputStream getPhoto(String path) throws FileNotFoundException;


    // 其他业务逻辑方法...
    public void getUserPhoto(String username, HttpServletResponse response) throws IOException;
}
